Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Displaying File Previews /


StandardGetFilePreview

The SFPGetFilePreview function allows you to display file previews in an Open dialog box using a standard file reply structure.

pascal void StandardGetFilePreview (FileFilterProcPtr fileFilter, 
                                    short numTypes, 
                                    SFTypeList typeList,
                                    StandardFileReply *reply); 
fileFilter

Points to a function that filters the files that are displayed to the user in the dialog box. This is an optional function provided by your application; if you do not want to supply a filter function, set this parameter to nil. The StandardGetFilePreview function uses this parameter along with the numTypes and typeList parameters to determine which files appear in the dialog box.
If this parameter is not nil, StandardGetFilePreview calls the function for each file to determine whether to display the file to the user. The StandardGetFilePreview function supplies you with information identifying the file (see Inside Macintosh: Files for more information about the format of this parameter data). Your function returns a Boolean value indicating whether to display the file. Set the Boolean value to false to cause the file to be displayed.
Your function must provide the following interface:
            pascal Boolean MyFileFilter (ParmBlkPtr parmBlock);
numTypes
Specifies the number of file types in the array specified by the typeList parameter (a number between 1 and 4). Set this parameter to -1 to display all files.
typeList
Specifies an array of file types to be displayed to the user. The StandardGetFilePreview function only displays files whose type matches an entry in this array (unless you set the numTypes parameter
to -1; in this case, the function displays all files to the user). The SFTypeList data type is defined as follows:
            typedef OSType SFTypeList[4];
reply
Contains a pointer to a reply structure that is to receive information about the user's selection. See Inside Macintosh: Files for more information about reply structures.
DESCRIPTION
The StandardGetFilePreview function presents an Open dialog box to the user and allows the user to view file previews. This function corresponds to the File Manager's StandardGetFile routine. See Inside Macintosh: Files for a comprehensive description of that routine and for more information about the parameters to this function. The StandardGetFilePreview function takes the same parameters as its existing counterpart with the addition of a where parameter that allows you to specify the location of the dialog box.

The StandardGetFilePreview function automatically converts files to movies if your application requests movies. If a file could be converted into a movie file using a movie import component, then the file is shown in the Standard File dialog box. See Figure 2-38 on page 2-59 for the dialog box with an automatic file-to-movie conversion option and Figure 2-39 on page 2-59 for the dialog box for saving a movie converted from a file.

Note
The StandardGetFilePreview function does not appear in the MPW interface file Movies.h; rather, it's listed in ImageCompression.h.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996